package com.gmq.chapter01;

/**
 * Created by gmq on 2017/08/08.
 * 不共享线程数据
 *
 * @version 1.0
 * @since 2017/08/08 15:54
 */
public class MyThread02 extends Thread {

    private int count = 5;

    public MyThread02(String name) {
        super();
        this.setName(name);     // 设置线程名称
    }

    @Override
    public void run() {
        super.run();
        while (count > 0) {
            count--;
            System.out.println(" 由 " + this.currentThread().getName() + " 计算，count= " + count);
        }
    }
}
